package gui;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;

import javax.media.jai.PlanarImage;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

import com.sun.media.jai.widget.DisplayJAI;

public class ImageGui {
	private static JFrame frame;
	
	static{
		frame = new JFrame();
		frame.setTitle("Display Result Images");

		frame.getContentPane().setLayout(new GridLayout(4,2));

		// Set the closing operation so the application is finished.
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(1000, 1000); // adjust the frame size.
		
	}
	
	public static void addImage(PlanarImage image){
		frame.setVisible(false);
		
		// Create an instance of DisplayJAI.
		DisplayJAI dj = new DisplayJAI(image);
		
		// Add to the JFrameí ContentPane an instance of JScrollPane
		// containing the DisplayJAI instance.
		frame.getContentPane().add(dj);
	}
	public static void showGui(){
		frame.setVisible(true);
	}

}
